package basicgrammer;
/**
 * I do not know how to do it ,
 * 
 * @author think
 *
 */
public class TestObj2 {
	private static int count = 0;
	private String sr ;
	TestObj2 t;
	public String getSr() {
		count++;//you can use a static variable in non-static function ..
		count--;//but you can not use non-static variable in static function.
		return sr;
	}
	public TestObj2 getT() {
		return t;
	}
	public void setSr(String sr) {
		this.sr = sr;
	}

	TestObj2(){

		count++;
		if(count>3){
			System.out.println("count > 20 stop ");
//			System.exit(0);
		}
		else{
			this.setSr("**"+count+"**");
			t=new TestObj2();
			}
	}
}
